#include "user.h"


int main()
{
	pid_t pid;
	printf("welcome the chat room,please intput your name:");
	scanf("%s",client_packet.name);
	getchar();
	if((pid =fork())<0)
	{
		printf("failed to fork\n");
		exit(1);
	}
	else if(pid > 0)
	{
		while(1)
		{	
			fgets(client_packet.data,100,stdin);
			client_send();
		}
	}
	else
	{
		while(1)
		{
			client_rcv();
		}
	}

}
